package com.ecfront.test.dao;

import java.util.Iterator;
import java.util.List;
import com.ecfront.dao.WebSiteDAO;
import com.ecfront.pojo.WebSite;
import junit.framework.TestCase;

public class testWebSite extends TestCase {
	private static final WebSiteDAO webSiteDao = (WebSiteDAO)SpringUtilTest.getBean("WebSiteDAO");
	private static final String Iterator = null;
	private Iterator iter;
	//保存更新测试
	public void testSaveOrUpdate(){
		WebSite ws = new WebSite();
		ws.setId(1);
		ws.setCompanyInfo("我们公司是非常NB的公司");
		ws.setCompanyName("柯南-更新");
		ws.setCompanySiteUrl("www.qa-buy.com");
		ws.setEmail("zhaoke@qaooo.com");
		ws.setFilter("江泽民|毛泽东|天才");
		ws.setGoodsTime(30);
		ws.setIcp("asd12354");
		ws.setInfo("超级网站");
		ws.setLogoUrl("/logo.jpg");
		ws.setName("超级网站");
		ws.setPhone("123456789");
		ws.setSmtpName("system@qaooo.com");
		ws.setSmtpService("mail.qaooo.com");
		ws.setSmtpPass("system");
		ws.setAdd("杭州百脑汇");
		webSiteDao.save(ws);
	}
	//得到属性测试
	public void testFindProperties(){
//		List list = webSiteDao.findAll();
//		for(Iterator iter = list.iterator();iter.hasNext();){
//			WebSite ws = (WebSite)iter.next();
//			System.out.println(ws.getCompanyInfo());
//		}
		WebSite ws = webSiteDao.findById(1);
		System.out.println(ws.getCompanyInfo());
	}
}
